一個 分散式版本控制系統(DVCS) 與傳統的集中式系統不同,因為沒有單一的中央倉儲強制要求所有人依賴。相反地,每位開發者都擁有一份專案完整歷史的完整備份。
1. 分散式的優勢
在此模型中,每個節點在技術上都是平等的。然而,我們會指定其中一個特定節點作為 官方倉儲 以維持專案標準。這需要一位 整合者——一個負責管理來自各個本地環境的貢獻如何流入公開領域的角色。
2. 安全存取協定
完整性透過特定的傳輸層來維持:
- HTTPS(或 SSH): 允許您取得或推送資料,但需要密碼。這可防止未知的開發者覆蓋提交內容。
- HTTP: 透過 HTTP 取得資料無需憑證,讓任何人都能開放讀取,同時不會影響寫入權限的安全性。
git config --global user.email [email protected]
3. Bitbucket 的角色
Bitbucket 是提供分散式版本控制系統(DVCS)託管服務的平台,讓您輕鬆建立 Git 倉儲並開始與團隊合作。它扮演您分散式工作流程的公開入口。
main.py
TERMINALbash — 80x24
> Ready. Click "Run" to execute.
>
QUESTION 1
What is the defining characteristic of a Distributed Version Control System (DVCS)?
It forces every developer to rely on a single central server.
There is no single central repository that Git forces everyone to rely upon.
It requires an internet connection for every commit.
History is stored only on the main server.
✅ Correct!
In a DVCS, every clone is a full backup of the project history, making the system decentralized.❌ Incorrect
That describes a Centralized system. In Git, everyone has their own copy of the repository.QUESTION 2
Which protocol allows developers to pull data anonymously but prevents unauthorized pushes?
SSH only
HTTP for fetching, HTTPS/SSH for pushing
Telnet
FTP
✅ Correct!
Fetching over HTTP usually requires no password, while HTTPS or SSH requires credentials to push changes.❌ Incorrect
Standard HTTP is typically read-only in Git, while HTTPS/SSH provides the security needed for write-access.QUESTION 3
Why do we designate an 'official repository' in a distributed model?
Because Git cannot function without a master server.
To serve as a project standard to maintain order among peer nodes.
To prevent developers from making local commits.
It is a requirement of the Bitbucket terms of service.
✅ Correct!
Technically all repositories are equal, but humans designate an 'official' one to ensure a clear source of truth.❌ Incorrect
Git functions perfectly without a server; the 'official' label is a workflow convention, not a technical requirement.QUESTION 4
Which command is used to set your identity for Git contributions?
git set user.email
git config --global user.email [email protected]
git identity --global
git login -u [email protected]
✅ Correct!
The `git config` command stores your email and name so every commit is traceable.❌ Incorrect
Git uses the `config` subcommand to manage settings like user identity.QUESTION 5
What role does Bitbucket play in this lesson?
It is a compiler for Git code.
It is a DVCS hosting provider for remote collaboration.
It is the primary operating system for Git.
It is a tool for centralized SVN management.
✅ Correct!
Bitbucket provides the infrastructure to host public repositories and manage distributed teams.❌ Incorrect
Bitbucket is a hosting platform, similar to GitHub, designed for DVCS like Git.Establishing the Distributed Gateway
Account Setup and Identity
You are transitioning a team of 500 developers from a centralized SVN server to a Distributed Integrator Model. You need to prepare the environment and establish your identity as the project's Lead Integrator.
Q
Navigate your web browser to Bitbucket.org and sign up for a free account. [Difficulty: Stem Words: 14, Length: Short]
Solution:
[⚠️ SYSTEM_WARNING: Missing Reference Answer. Instructor must manually provide the answer during class.]
[⚠️ SYSTEM_WARNING: Missing Reference Answer. Instructor must manually provide the answer during class.]
Q
Explain how the 'Distributed Integrator Model' prevents bottlenecks compared to a centralized workflow.
Solution:
In a centralized workflow, every developer tries to write to one server, creating a bottleneck. In the Integrator model, developers push to their own public gateways (like Bitbucket). The Integrator then selectively pulls only the best, reviewed features into the 'official' version, distributing the workload and ensuring code quality.
In a centralized workflow, every developer tries to write to one server, creating a bottleneck. In the Integrator model, developers push to their own public gateways (like Bitbucket). The Integrator then selectively pulls only the best, reviewed features into the 'official' version, distributing the workload and ensuring code quality.